package com.cl.postprocessor.impl;

import com.cl.annotation.ClComponent;
import com.cl.component.Cat;
import com.cl.container.ClBean;
import com.cl.postprocessor.IBeanPostProcessor;

@ClComponent("BeanPostProcessorImpl")
public class BeanPostProcessorImpl implements IBeanPostProcessor {
    @Override
    public void postProcessor(ClBean clBean) {
        System.out.println("bean post processor。。。。。");
        System.out.println(clBean.getObject().getClass());

        /*
        * 让此bean不注入容器 (每次创建都会走这个方法,每次都注入不进去,就会报空指针异常)
        * */
        if (clBean.getObject() instanceof Cat) {
            //clBean.setInjectContainer(false);
        }
    }
}
